<template>
  <view class="container">
    <!-- Left side: Two boxes -->
    <view class="left-side">
      <view class="box green-bg" style=" margin-bottom: 10px;">
        <view style="display: flex; align-items: center;">
          <view class="icon" style="background-color: #4CAF50;"></view>
          <view class="title">预约到店服务</view>
        </view>
        <view class="subtitle">专业机构 · 限时免费</view>
        <view class="fw-button">去看看</view>
      </view>
      <view class="box blue-bg">
        <view style="display: flex; align-items: center;">
          <view class="icon" style="background-color: #4570FF;"></view>
          <view class="title">健康小课堂</view>
        </view>
        <view class="subtitle">科学养生 · 冷知识</view>
        <view class="jk-button">去看看</view>
      </view>
    </view>
    
    <!-- Right side: One box -->
    <view class="right-side">
      <view class="box white-bg">
        <view class="title-row">
          <text class="title">买赠专区</text>
          <text class="see-all">全部 ></text>
        </view>
        <view class="product-column">
          <view class="product-card" style="margin-bottom: 10px;">
            <view class="product-image light-green"></view>
            <view class="product-info">
              <view class="product-title">斯维诗护肝...</view>
              <view class="product-gift">送便携分药盒</view>
              <view class="product-price">¥169</view>
            </view>
          </view>
          <view class="product-card">
            <view class="product-image light-red"></view>
            <view class="product-info">
              <view class="product-title">西洋参燕窝...</view>
              <view class="product-gift">送精致汤匙</view>
              <view class="product-price">¥503.10</view>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: 'LayoutComponent'
}
</script>

<style scoped>

.icon {
  width: 4px;
  height: 16px;
  margin-right: 5px;
  border-radius: 10px;
}

.container {
  display: flex;
  padding: 10px;
  background-color: #f5f5f5;
}

.left-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-right: 10px;
}

.right-side {
  flex: 1;
}

.box {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
 
}

.green-bg {
  background-color: #fff;
  background-image: url('https://safood.supplyocta.com/Uploads/tempImage/2024-08-30/66d12c16984ac7639.png');
  background-size: contain;
  background-position: bottom;
  background-repeat: no-repeat;

}

.blue-bg {
  background-color: #fff;
  background-image: url('https://safood.supplyocta.com/Uploads/tempImage/2024-08-30/66d12cc496f1d1622.png');
  background-size: contain;
  background-position: bottom;
  background-repeat: no-repeat;

}

.white-bg {
  background-color: #fff;
  background-image: url('https://safood.supplyocta.com/Uploads/tempImage/2024-08-30/66d12e26a07823873.png');
  background-size: contain;
  background-position: top;
  background-repeat: no-repeat;

}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.title {
  font-size: 16px;
  font-weight: bold;
}

.subtitle {
  font-size: 12px;
  color: #666;
  margin-bottom: 10px;
}

.fw-button {
  background: linear-gradient( 340deg, #4DB567 0%, #80D997 100%);

}
.jk-button{
  background: linear-gradient( 340deg, #4570FF 0%, #83A7FF 100%);
}

.fw-button,.jk-button{
  padding: 5px 10px;
  border-radius: 15px;
  display: inline-block;
  font-size: 12px;
  width: 85px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  margin-left: 10px;
}

.see-all {
  font-size: 12px;
  color: #999;
}

.product-column {
  display: flex;
  flex-direction: column;
}

.product-card {
  display: flex;
  /* padding: 10px; */
  background-color: #f9f9f9;
  border-radius: 8px;
}

.product-image {
  width: 80px;
  height: 80px;
  border-radius: 5px;
  margin-right: 5px;
}

.product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.light-green {
  background-color: #c8e6c9;
  background-image: url('http://gips3.baidu.com/it/u=4283915297,3700662292&fm=3028&app=3028&f=JPEG&fmt=auto?w=1440&h=2560');
  background-size: cover;
}

.light-red {
  background-color: #ffcdd2;
  background-image: url('http://gips3.baidu.com/it/u=4283915297,3700662292&fm=3028&app=3028&f=JPEG&fmt=auto?w=1440&h=2560');
  background-size: cover;
}

.product-title {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%; /* 可以根据需要调整宽度 */
  max-width: calc(1.2em * 5); /* 假设每个字大约占1.2em宽度 */
}

.product-price {
  font-size: 16px;
  color: #f44336;
  font-weight: bold;
}

.product-gift {
  font-size: 12px;
  color: #FF7C71;
  height: 20px;
  border-radius: 4px;
  border: 1px solid #FF7C71;
  text-align: center;
  margin: 3px 0;
  width: 75px;
}
</style>